package game;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 *
 * @author group19
 */
public class Command {	

        final int NR_OF_TRAINING_MATCHES = 2000;

	public enum COM{Train, Pubeval, Human, Pub};
	private boolean debug = true;
	public ArrayList<Controller> gameLobby = new ArrayList<Controller>();
	public static Command comClass;
	
	
	public Command(){
		comClass = this;
	}
	
	// program start
	public static void main(String [] args){
		(new Command()).commandLine();
	}
	
	
	
	/**
	 * Start the command shell
	 */	
	public void start(){
		// star Command line
	//	commandLine();
		
	}	
	
	// Another thread for the command line!
	public void commandLine(){
		COM command;
		// 1 around
		while(true){
			command = getCommand();
			if (debug)
				System.out.println(command);
			switch(command){
			case Human: (new Controller()).start();break;
			case Train: (new Controller()).startAI(NR_OF_TRAINING_MATCHES);break;
			case Pubeval: (new Controller()).startAIpub();break;
                        case Pub:(new Controller()).startPubPub();break;
			default: break;
				
			}
			
		}
	}
	
	/*
	 * When playing with the user or getting commands from the user ,, ,such as print out!
	 */
	public COM getCommand(){
		while (true){
			System.out.print("Command> ");
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try {
			   return  COM.valueOf(br.readLine());
			} catch (Exception ioe) {
			   System.out.println("Write something readable!");
			}		
		}		
	}
	

}
